class Frag1Fire extends FragFire;

function projectile SpawnProjectile(Vector Start, Rotator Dir)
{
	local Grenade g;
	local vector X, Y, Z;
	local float pawnSpeed;
	local SupportBoxPickup AS;
	local MedicFirstAidKit AK;
	
	SRHumanPawn(Instigator).ConsumeStamina(5.0);

	if ( KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo) != none && KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill != none )
	{
		if ( KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.Static.GetNadeType(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo)) == class'SupportAmmoNade' )
		{
			GetAxes(Instigator.Rotation,X,Y,Z);
			AS = Spawn(class'SupportBoxPickup',Instigator,,Instigator.Location + ( Instigator.CollisionRadius + class'SupportBoxPickup'.default.CollisionRadius + 5 ) * X,Dir);
			AS.Velocity = vect(150,0,0) >> Instigator.GetViewRotation();
			AS.GotoState('Pickup');
			return none;
		}
		else if ( KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.Static.GetNadeType(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo)) == class'SupportHealNade' )
		{
			GetAxes(Instigator.Rotation,X,Y,Z);
			AK = Spawn(class'MedicFirstAidKit',Instigator,,Instigator.Location + ( Instigator.CollisionRadius + class'MedicFirstAidKit'.default.CollisionRadius + 5 ) * X,Dir);
			AK.Velocity = vect(200,0,0) >> Instigator.GetViewRotation();
			if ( !KFGameReplicationInfo(KFGameType(Level.Game).GameReplicationInfo).bWaveInProgress )
				SRPlayerReplicationInfo(Instigator.Controller.PlayerReplicationInfo).MedKitsDropped++;
			return none;
		}
		else
		{
			g = Weapon.Spawn(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.Static.GetNadeType(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo)), instigator,, Start, Dir);
		}
	}
	else
	{
		g = Weapon.Spawn(class'SnitchNade', instigator,, Start, Dir);
	}

	if (g != None)
	{
		Weapon.GetViewAxes(X,Y,Z);
		pawnSpeed = X dot Instigator.Velocity;

		if ( Bot(Instigator.Controller) != None )
		{
			g.Speed = mHoldSpeedMax;
		}
		else
		{
			g.Speed = mHoldSpeedMin + HoldTime*mHoldSpeedGainPerSec;
		}

		g.Speed = FClamp(g.Speed, mHoldSpeedMin, mHoldSpeedMax);
		g.Speed = pawnSpeed + g.Speed;
		g.Velocity = g.Speed * Vector(Dir);
		g.Damage *= DamageAtten;
	}

	return g;
}

defaultproperties
{
     AmmoClass=Class'Frag1Ammo'
     ProjectileClass=Class'SnitchNade'
}
